package com.example.entity;

import java.io.Serializable;
import java.util.ArrayList;

@SuppressWarnings("serial")
public class ItemList<E> extends ArrayList<Item> implements Serializable {

	public void removeItem(Item object) {
		remove(object);
	}
	
	public void removeItem(String key) {
		for (Item item : this) {
			if (key.equals(item.getKey())) {
				remove(item);
				return;
			}
		}
	}

	public Item get(String key) {
		for (Item item : this) {
			if (key.equals(item.getKey())) {
				return item;
			}
		}
		
		return null;
	}
}
